+2007-12-22 Christian Persch <chpe@gnome.org>
+
+ * modules/other/gail/*.[ch]: Remove relocations from the atk
+ factories. Remove unused gail_foo_new() functions. Fix object
+ instantiation to be derivation safe by moving initialisation code
+ from the removed gail_foo_new() functions to the
+ AtkObjectClass::initialize implementation. Bug #505226.
+
2007-12-24 Matthias Clasen <mclasen@redhat.com>
* modules/other/gail/gailentry.c:
gailadjustment.c \
gailarrow.c \
gailbooleancell.c \
- gailbooleancellfactory.c \
gailbox.c \
gailbutton.c \
gailcalendar.c \
gailframe.c \
gailimage.c \
gailimagecell.c \
- gailimagecellfactory.c \
gailitem.c \
gaillabel.c \
gaillist.c \
gailnotebook.c \
gailnotebookpage.c \
gailobject.c \
- gailobjectfactory.c \
gailoptionmenu.c \
gailpaned.c \
gailpixmap.c \
gailradiosubmenuitem.c \
gailrange.c \
gailrenderercell.c \
- gailrenderercellfactory.c \
gailscale.c \
gailscrollbar.c \
gailscrolledwindow.c \
gailsubmenuitem.c \
gailstatusbar.c \
gailtextcell.c \
- gailtextcellfactory.c \
gailtextview.c \
gailtogglebutton.c \
gailtoplevel.c \
gailadjustment.h \
gailarrow.h \
gailbooleancell.h \
- gailbooleancellfactory.h \
gailbox.h \
gailbutton.h \
gailcalendar.h \
gailframe.h \
gailimage.h \
gailimagecell.h \
- gailimagecellfactory.h \
gailitem.h \
gaillabel.h \
gaillist.h \
gailnotebook.h \
gailnotebookpage.h \
gailobject.h \
- gailobjectfactory.h \
gailoptionmenu.h \
gailpaned.h \
gailpixmap.h \
gailradiosubmenuitem.h \
gailrange.h \
gailrenderercell.h \
- gailrenderercellfactory.h \
gailscale.h \
gailscrollbar.h \
gailscrolledwindow.h \
gailsubmenuitem.h \
gailstatusbar.h \
gailtextcell.h \
- gailtextcellfactory.h \
gailtextview.h \
gailtogglebutton.h \
gailtoplevel.h \
static guint focus_tracker_id = 0;
static GQuark quark_focus_object = 0;
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_WIDGET, gail_widget, gail_widget_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CONTAINER, gail_container, gail_container_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_BUTTON, gail_button, gail_button_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_ITEM, gail_item, gail_item_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_MENU_ITEM, gail_menu_item, gail_menu_item_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_TOGGLE_BUTTON, gail_toggle_button, gail_toggle_button_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_IMAGE, gail_image, gail_image_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_TEXT_VIEW, gail_text_view, gail_text_view_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_COMBO, gail_combo, gail_combo_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_COMBO_BOX, gail_combo_box, gail_combo_box_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_ENTRY, gail_entry, gail_entry_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_MENU_SHELL, gail_menu_shell, gail_menu_shell_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_MENU, gail_menu, gail_menu_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_WINDOW, gail_window, gail_window_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_RANGE, gail_range, gail_range_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SCALE, gail_scale, gail_scale_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CLIST, gail_clist, gail_clist_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_LABEL, gail_label, gail_label_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_STATUSBAR, gail_statusbar, gail_statusbar_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_NOTEBOOK, gail_notebook, gail_notebook_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CALENDAR, gail_calendar, gail_calendar_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_PROGRESS_BAR, gail_progress_bar, gail_progress_bar_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SPIN_BUTTON, gail_spin_button, gail_spin_button_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_TREE_VIEW, gail_tree_view, gail_tree_view_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_FRAME, gail_frame, gail_frame_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_RADIO_BUTTON, gail_radio_button, gail_radio_button_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_ARROW, gail_arrow, gail_arrow_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_PIXMAP, gail_pixmap, gail_pixmap_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SEPARATOR, gail_separator, gail_separator_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_BOX, gail_box, gail_box_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, gail_scrolled_window, gail_scrolled_window_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_LIST, gail_list, gail_list_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_PANED, gail_paned, gail_paned_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SCROLLBAR, gail_scrollbar, gail_scrollbar_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_OPTION_MENU, gail_option_menu, gail_option_menu_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CHECK_MENU_ITEM, gail_check_menu_item, gail_check_menu_item_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_RADIO_MENU_ITEM, gail_radio_menu_item, gail_radio_menu_item_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_EXPANDER, gail_expander, gail_expander_new)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_OBJECT, GailObject, gail_object, GTK_TYPE_OBJECT)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WIDGET, GailWidget, gail_widget, GTK_TYPE_WIDGET)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CONTAINER, GailContainer, gail_container, GTK_TYPE_CONTAINER)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BUTTON, GailButton, gail_button, GTK_TYPE_BUTTON)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ITEM, GailItem, gail_item, GTK_TYPE_ITEM)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_MENU_ITEM, GailMenuItem, gail_menu_item, gail_menu_item_new)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TOGGLE_BUTTON, GailToggleButton, gail_toggle_button, GTK_TYPE_TOGGLE_BUTTON)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_IMAGE, GailImage, gail_image, GTK_TYPE_IMAGE)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TEXT_VIEW, GailTextView, gail_text_view, GTK_TYPE_TEXT_VIEW)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_COMBO, GailCombo, gail_combo, GTK_TYPE_COMBO)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_COMBO_BOX, GailComboBox, gail_combo_box, GTK_TYPE_COMBO_BOX)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ENTRY, GailEntry, gail_entry, GTK_TYPE_ENTRY)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU_SHELL, GailMenuShell, gail_menu_shell, GTK_TYPE_MENU_SHELL)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU, GailMenu, gail_menu, GTK_TYPE_MENU)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WINDOW, GailWindow, gail_window, GTK_TYPE_BIN)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RANGE, GailRange, gail_range, GTK_TYPE_RANGE)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCALE, GailScale, gail_scale, GTK_TYPE_SCALE)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CLIST, GailCList, gail_clist, GTK_TYPE_CLIST)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LABEL, GailLabel, gail_label, GTK_TYPE_LABEL)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_TYPE_STATUSBAR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CALENDAR, GailCalendar, gail_calendar, GTK_TYPE_CALENDAR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PROGRESS_BAR, GailProgressBar, gail_progress_bar, GTK_TYPE_PROGRESS_BAR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SPIN_BUTTON, GailSpinButton, gail_spin_button, GTK_TYPE_SPIN_BUTTON)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TREE_VIEW, GailTreeView, gail_tree_view, GTK_TYPE_TREE_VIEW)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_FRAME, GailFrame, gail_frame, GTK_TYPE_FRAME)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RADIO_BUTTON, GailRadioButton, gail_radio_button, GTK_TYPE_RADIO_BUTTON)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ARROW, GailArrow, gail_arrow, GTK_TYPE_ARROW)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PIXMAP, GailPixmap, gail_pixmap, GTK_TYPE_PIXMAP)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SEPARATOR, GailSeparator, gail_separator, GTK_TYPE_SEPARATOR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BOX, GailBox, gail_box, GTK_TYPE_BOX)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, GailScrolledWindow, gail_scrolled_window, GTK_TYPE_SCROLLED_WINDOW)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LIST, GailList, gail_list, GTK_TYPE_LIST)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PANED, GailPaned, gail_paned, GTK_TYPE_PANED)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLBAR, GailScrollbar, gail_scrollbar, GTK_TYPE_SCROLLBAR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_OPTION_MENU, GailOptionMenu, gail_option_menu, GTK_TYPE_OPTION_MENU)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_CHECK_MENU_ITEM, GailCheckMenuItem, gail_check_menu_item, gail_check_menu_item_new)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_RADIO_MENU_ITEM, GailRadioMenuItem, gail_radio_menu_item, gail_radio_menu_item_new)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_EXPANDER, GailExpander, gail_expander, GTK_TYPE_EXPANDER)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_RENDERER_CELL, GailRendererCell, gail_renderer_cell, GTK_TYPE_CELL_RENDERER, gail_renderer_cell_new)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_BOOLEAN_CELL, GailBooleanCell, gail_boolean_cell, GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell_new)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_IMAGE_CELL, GailImageCell, gail_image_cell, GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell_new)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_TEXT_CELL, GailTextCell, gail_text_cell, GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell_new)
static AtkObject*
gail_get_accessible_for_widget (GtkWidget *widget,
#include <gail/gailadjustment.h>
#include <gail/gailarrow.h>
#include <gail/gailbooleancell.h>
-#include <gail/gailbooleancellfactory.h>
#include <gail/gailbox.h>
#include <gail/gailbutton.h>
#include <gail/gailcalendar.h>
#include <gail/gailframe.h>
#include <gail/gailimage.h>
#include <gail/gailimagecell.h>
-#include <gail/gailimagecellfactory.h>
#include <gail/gailitem.h>
#include <gail/gaillabel.h>
#include <gail/gaillist.h>
#include <gail/gailmenuitem.h>
#include <gail/gailnotebook.h>
#include <gail/gailobject.h>
-#include <gail/gailobjectfactory.h>
#include <gail/gailoptionmenu.h>
#include <gail/gailpaned.h>
#include <gail/gailpixmap.h>
#include <gail/gailradiobutton.h>
#include <gail/gailradiomenuitem.h>
#include <gail/gailrenderercell.h>
-#include <gail/gailrenderercellfactory.h>
#include <gail/gailrange.h>
#include <gail/gailscale.h>
#include <gail/gailscrollbar.h>
#include <gail/gailspinbutton.h>
#include <gail/gailstatusbar.h>
#include <gail/gailtextcell.h>
-#include <gail/gailtextcellfactory.h>
#include <gail/gailtextview.h>
#include <gail/gailtogglebutton.h>
#include <gail/gailtoplevel.h>
object = g_object_new (GAIL_TYPE_ADJUSTMENT, NULL);
- g_return_val_if_fail (object != NULL, NULL);
-
atk_object = ATK_OBJECT (object);
atk_object_initialize (atk_object, adjustment);
static void gail_arrow_class_init (GailArrowClass *klass);
static void gail_arrow_init (GailArrow *arrow);
+static void gail_arrow_initialize (AtkObject *accessible,
+ gpointer data);
/* AtkImage */
static void atk_image_interface_init (AtkImageIface *iface);
gail_arrow_class_init (GailArrowClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
+
+ atk_object_class->initialize = gail_arrow_initialize;
gobject_class->finalize = gail_arrow_finalize;
}
arrow->image_description = NULL;
}
-AtkObject*
-gail_arrow_new (GtkWidget *widget)
+static void
+gail_arrow_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_ARROW (widget), NULL);
+ ATK_OBJECT_CLASS (gail_arrow_parent_class)->initialize (accessible, data);
- object = g_object_new (GAIL_TYPE_ARROW, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
accessible->role = ATK_ROLE_ICON;
-
- return accessible;
}
static void
GailWidgetClass parent_class;
};
-AtkObject* gail_arrow_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
+++ /dev/null
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkcellrenderertoggle.h>
-#include "gailbooleancellfactory.h"
-#include "gailbooleancell.h"
-
-static void gail_boolean_cell_factory_class_init (GailBooleanCellFactoryClass *klass);
-
-static AtkObject* gail_boolean_cell_factory_create_accessible (
- GObject *obj);
-static GType gail_boolean_cell_factory_get_accessible_type (void);
-
-GType
-gail_boolean_cell_factory_get_type (void)
-{
- static GType type = 0;
-
- if (!type)
- {
- static const GTypeInfo tinfo =
- {
- sizeof (GailBooleanCellFactoryClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) gail_boolean_cell_factory_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (GailBooleanCellFactory), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
- type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY,
- "GailBooleanCellFactory" , &tinfo, 0);
- }
-
- return type;
-}
-
-static void
-gail_boolean_cell_factory_class_init (GailBooleanCellFactoryClass *klass)
-{
- AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
- class->create_accessible = gail_boolean_cell_factory_create_accessible;
- class->get_accessible_type = gail_boolean_cell_factory_get_accessible_type;
-}
-
-static AtkObject*
-gail_boolean_cell_factory_create_accessible (GObject *obj)
-{
- g_return_val_if_fail (GTK_IS_CELL_RENDERER_TOGGLE (obj), NULL);
-
- return gail_boolean_cell_new ();
-}
-
-static GType
-gail_boolean_cell_factory_get_accessible_type (void)
-{
- return GAIL_TYPE_BOOLEAN_CELL;
-}
+++ /dev/null
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_BOOLEAN_CELL_FACTORY_H__
-#define __GAIL_BOOLEAN_CELL_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_BOOLEAN_CELL_FACTORY (gail_boolean_cell_factory_get_type ())
-#define GAIL_BOOLEAN_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_BOOLEAN_CELL_FACTORY, GailBooleanCellFactory))
-#define GAIL_BOOLEAN_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_BOOLEAN_CELL_FACTORY, GailBooleanCellFactoryClass))
-#define GAIL_IS_BOOLEAN_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_BOOLEAN_CELL_FACTORY))
-#define GAIL_IS_BOOLEAN_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_BOOLEAN_CELL_FACTORY))
-#define GAIL_BOOLEAN_CELL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_BOOLEAN_CELL_FACTORY, GailBooleanCellFactoryClass))
-
-typedef struct _GailBooleanCellFactory GailBooleanCellFactory;
-typedef struct _GailBooleanCellFactoryClass GailBooleanCellFactoryClass;
-
-struct _GailBooleanCellFactory
-{
- AtkObjectFactory parent;
-};
-
-struct _GailBooleanCellFactoryClass
-{
- AtkObjectFactoryClass parent_class;
-};
-
-GType gail_boolean_cell_factory_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_BOOLEAN_CELL_FACTORY_H__ */
static void gail_box_class_init (GailBoxClass *klass);
static void gail_box_init (GailBox *box);
+static void gail_box_initialize (AtkObject *accessible,
+ gpointer data);
static AtkStateSet* gail_box_ref_state_set (AtkObject *accessible);
G_DEFINE_TYPE (GailBox, gail_box, GAIL_TYPE_CONTAINER)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+ class->initialize = gail_box_initialize;
class->ref_state_set = gail_box_ref_state_set;
}
{
}
-AtkObject*
-gail_box_new (GtkWidget *widget)
+static void
+gail_box_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_BOX (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_BOX, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
+ ATK_OBJECT_CLASS (gail_box_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_FILLER;
-
- return accessible;
}
static AtkStateSet*
GailContainerClass parent_class;
};
-AtkObject* gail_box_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
button->textutil = NULL;
}
-AtkObject*
-gail_button_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_BUTTON (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_BUTTON, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static G_CONST_RETURN gchar*
gail_button_get_name (AtkObject *obj)
{
GailContainerClass parent_class;
};
-AtkObject* gail_button_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
static void gail_calendar_class_init (GailCalendarClass *klass);
static void gail_calendar_init (GailCalendar *calendar);
+static void gail_calendar_initialize (AtkObject *accessible,
+ gpointer data);
G_DEFINE_TYPE (GailCalendar, gail_calendar, GAIL_TYPE_WIDGET)
static void
gail_calendar_class_init (GailCalendarClass *klass)
{
+ AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
+
+ atk_object_class->initialize = gail_calendar_initialize;
}
static void
{
}
-AtkObject*
-gail_calendar_new (GtkWidget *widget)
+static void
+gail_calendar_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_CALENDAR (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_CALENDAR, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
+ ATK_OBJECT_CLASS (gail_calendar_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_CALENDAR;
-
- return accessible;
}
GailWidgetClass parent_class;
};
-AtkObject* gail_calendar_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
{
}
-AtkObject*
-gail_clist_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_CLIST (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_CLIST, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- accessible->role = ATK_ROLE_TABLE;
-
- return accessible;
-}
-
static void
gail_clist_real_initialize (AtkObject *obj,
gpointer data)
ATK_OBJECT_CLASS (gail_clist_parent_class)->initialize (obj, data);
+ obj->role = ATK_ROLE_TABLE;
+
clist = GAIL_CLIST (obj);
clist->caption = NULL;
GailContainerClass parent_class;
};
-AtkObject* gail_clist_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
combo->select_idle_handler = 0;
}
-AtkObject*
-gail_combo_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_COMBO (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_COMBO, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_combo_real_initialize (AtkObject *obj,
gpointer data)
GailContainerClass parent_class;
};
-AtkObject* gail_combo_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
combo_box->popup_set = FALSE;
}
-AtkObject*
-gail_combo_box_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_COMBO_BOX (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_COMBO_BOX, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_combo_box_real_initialize (AtkObject *obj,
gpointer data)
GailContainerClass parent_class;
};
-AtkObject* gail_combo_box_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
container->children = NULL;
}
-AtkObject*
-gail_container_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_CONTAINER (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_CONTAINER, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
-static gint
+static gint
gail_container_get_n_children (AtkObject* obj)
{
GtkWidget *widget;
gpointer data);
};
-AtkObject* gail_container_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_OBJECT_CLASS (gail_entry_parent_class)->finalize (object);
}
-AtkObject*
-gail_entry_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_ENTRY (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_ENTRY, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static gint
gail_entry_get_index_in_parent (AtkObject *accessible)
{
GailWidgetClass parent_class;
};
-AtkObject* gail_entry_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
expander->textutil = NULL;
}
-AtkObject*
-gail_expander_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_EXPANDER (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_EXPANDER, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static G_CONST_RETURN gchar*
gail_expander_get_name (AtkObject *obj)
{
GailContainerClass parent_class;
};
-AtkObject* gail_expander_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
/* GAIL - The GNOME Accessibility Implementation Library
* Copyright 2002 Sun Microsystems Inc.
+ * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ * Copyright (C) 2007 Christian Persch
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
#include <glib-object.h>
#include <atk/atkobject.h>
-#define GAIL_ACCESSIBLE_FACTORY(type, type_as_function, opt_create_accessible) \
- \
-static GType \
-type_as_function ## _factory_get_accessible_type (void) \
-{ \
- return type; \
-} \
- \
-static AtkObject* \
-type_as_function ## _factory_create_accessible (GObject *obj) \
-{ \
- GtkWidget *widget; \
- AtkObject *accessible; \
- \
- g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL); \
- \
- widget = GTK_WIDGET (obj); \
- \
- accessible = opt_create_accessible (widget); \
- \
- return accessible; \
-} \
- \
-static void \
-type_as_function ## _factory_class_init (AtkObjectFactoryClass *klass) \
-{ \
- klass->create_accessible = type_as_function ## _factory_create_accessible; \
- klass->get_accessible_type = type_as_function ## _factory_get_accessible_type;\
-} \
- \
-static GType \
-type_as_function ## _factory_get_type (void) \
-{ \
- static GType t = 0; \
- \
- if (!t) \
- { \
- char *name; \
- static const GTypeInfo tinfo = \
- { \
- sizeof (AtkObjectFactoryClass), \
- NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \
- NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL \
- }; \
- \
- name = g_strconcat (g_type_name (type), "Factory", NULL); \
- t = g_type_register_static ( \
- ATK_TYPE_OBJECT_FACTORY, name, &tinfo, 0); \
- g_free (name); \
- } \
- \
- return t; \
+#define _GAIL_IMPLEMENT_FACTORY_CREATE_ACCESSIBLE(GAIL_TYPE, TYPE) \
+{ \
+ AtkObject *accessible; \
+\
+ g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, TYPE), NULL); \
+\
+ accessible = g_object_new (GAIL_TYPE, NULL); \
+ atk_object_initialize (accessible, object); \
+\
+ return accessible; \
}
+#define _GAIL_IMPLEMENT_FACTORY_BEGIN(GAIL_TYPE, TypeName, type_name) \
+\
+static GType \
+type_name##_factory_get_accessible_type (void) \
+{ \
+ return GAIL_TYPE; \
+} \
+\
+static AtkObject* \
+type_name##_factory_create_accessible (GObject *object) \
+{
+
+#define _GAIL_IMPLEMENT_FACTORY_END(GAIL_TYPE, TypeName, type_name) \
+} \
+\
+static void \
+type_name##_factory_class_init (AtkObjectFactoryClass *klass) \
+{ \
+ klass->create_accessible = type_name ## _factory_create_accessible; \
+ klass->get_accessible_type = type_name ## _factory_get_accessible_type;\
+} \
+\
+GType \
+type_name##_factory_get_type (void) \
+{ \
+ static volatile gsize g_define_type_id__volatile = 0; \
+ if (g_once_init_enter (&g_define_type_id__volatile)) \
+ { \
+ GType g_define_type_id = \
+ g_type_register_static_simple (ATK_TYPE_OBJECT_FACTORY, \
+ g_intern_static_string (#TypeName "Factory"), \
+ sizeof (AtkObjectFactoryClass), \
+ (GClassInitFunc) type_name##_factory_class_init, \
+ sizeof (AtkObjectFactory), \
+ (GInstanceInitFunc) NULL, \
+ (GTypeFlags) 0); \
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
+ } \
+ return g_define_type_id__volatile; \
+}
+
+/* Implements a AtkObjectFactory creating accessibles of type
+ * @GAIL_TYPE for objects of type @TYPE.
+ */
+#define GAIL_IMPLEMENT_FACTORY(GAIL_TYPE, TypeName, type_name, TYPE) \
+_GAIL_IMPLEMENT_FACTORY_BEGIN (GAIL_TYPE, TypeName, type_name) \
+_GAIL_IMPLEMENT_FACTORY_CREATE_ACCESSIBLE (GAIL_TYPE, TYPE) \
+_GAIL_IMPLEMENT_FACTORY_END (GAIL_TYPE, TypeName, type_name)
+
+/* Implements a AtkObjectFactory creating accessibles of type
+ * @GAIL_TYPE with creation func @create_accessible.
+ */
+#define GAIL_IMPLEMENT_FACTORY_WITH_FUNC(GAIL_TYPE, TypeName, type_name, create_accessible) \
+_GAIL_IMPLEMENT_FACTORY_BEGIN (GAIL_TYPE, TypeName, type_name) \
+{ return create_accessible (GTK_WIDGET (object)); } \
+_GAIL_IMPLEMENT_FACTORY_END (GAIL_TYPE, TypeName, type_name)
+
+#define GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY(GAIL_TYPE, TypeName, type_name, TYPE, create_accessible) \
+_GAIL_IMPLEMENT_FACTORY_BEGIN (GAIL_TYPE, TypeName, type_name) \
+{ \
+ g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, TYPE), NULL);\
+ return create_accessible (); \
+} \
+_GAIL_IMPLEMENT_FACTORY_END (GAIL_TYPE, TypeName, type_name)
+
#define GAIL_WIDGET_SET_FACTORY(widget_type, type_as_function) \
atk_registry_set_factory_type (atk_get_default_registry (), \
widget_type, \
static void gail_frame_class_init (GailFrameClass *klass);
static void gail_frame_init (GailFrame *frame);
+static void gail_frame_initialize (AtkObject *accessible,
+ gpointer data);
static G_CONST_RETURN gchar* gail_frame_get_name (AtkObject *obj);
G_DEFINE_TYPE (GailFrame, gail_frame, GAIL_TYPE_CONTAINER)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+ class->initialize = gail_frame_initialize;
class->get_name = gail_frame_get_name;
}
{
}
-AtkObject*
-gail_frame_new (GtkWidget *widget)
+static void
+gail_frame_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_FRAME (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_FRAME, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
+ ATK_OBJECT_CLASS (gail_frame_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_PANEL;
-
- return accessible;
}
static G_CONST_RETURN gchar*
GailContainerClass parent_class;
};
-AtkObject* gail_frame_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
class->initialize = gail_html_box_initialize;
}
-AtkObject*
-gail_html_box_new (GObject *obj)
-{
- GObject *object;
- AtkObject *atk_object;
-
- g_return_val_if_fail (HTML_IS_BOX (obj), NULL);
- object = g_object_new (GAIL_TYPE_HTML_BOX, NULL);
- atk_object = ATK_OBJECT (object);
- atk_object_initialize (atk_object, obj);
- atk_object->role = ATK_ROLE_UNKNOWN;
- return atk_object;
-}
-
static void
gail_html_box_initialize (AtkObject *obj,
gpointer data)
{
HtmlBox *box;
+
ATK_OBJECT_CLASS (gail_html_box_parent_class)->initialize (obj, data);
+ obj->role = ATK_ROLE_UNKNOWN;
+
box = HTML_BOX (data);
/*
GType gail_html_box_get_type (void);
-AtkObject* gail_html_box_new (GObject *obj);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
static void gail_image_class_init (GailImageClass *klass);
static void gail_image_init (GailImage *image);
+static void gail_image_initialize (AtkObject *accessible,
+ gpointer data);
static G_CONST_RETURN gchar* gail_image_get_name (AtkObject *accessible);
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
gobject_class->finalize = gail_image_finalize;
+ class->initialize = gail_image_initialize;
class->get_name = gail_image_get_name;
}
image->image_description = NULL;
}
-AtkObject*
-gail_image_new (GtkWidget *widget)
+static void
+gail_image_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_IMAGE (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_IMAGE, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
+ ATK_OBJECT_CLASS (gail_image_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_ICON;
-
- return accessible;
}
/* Copied from gtktoolbar.c, keep in sync */
GailWidgetClass parent_class;
};
-AtkObject* gail_image_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
+++ /dev/null
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkcellrendererpixbuf.h>
-#include "gailimagecellfactory.h"
-#include "gailimagecell.h"
-
-static void gail_image_cell_factory_class_init (GailImageCellFactoryClass *klass);
-
-static AtkObject* gail_image_cell_factory_create_accessible (
- GObject *obj);
-
-static GType gail_image_cell_factory_get_accessible_type (void);
-
-GType
-gail_image_cell_factory_get_type (void)
-{
- static GType type = 0;
-
- if (!type)
- {
- static const GTypeInfo tinfo =
- {
- sizeof (GailImageCellFactoryClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) gail_image_cell_factory_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (GailImageCellFactory), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
- type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY,
- "GailImageCellFactory" , &tinfo, 0);
- }
-
- return type;
-}
-
-static void
-gail_image_cell_factory_class_init (GailImageCellFactoryClass *klass)
-{
- AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
- class->create_accessible = gail_image_cell_factory_create_accessible;
- class->get_accessible_type = gail_image_cell_factory_get_accessible_type;
-}
-
-static AtkObject*
-gail_image_cell_factory_create_accessible (GObject *obj)
-{
- g_return_val_if_fail (GTK_IS_CELL_RENDERER_PIXBUF (obj), NULL);
-
- return gail_image_cell_new ();
-}
-
-static GType
-gail_image_cell_factory_get_accessible_type (void)
-{
- return GAIL_TYPE_IMAGE_CELL;
-}
+++ /dev/null
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_IMAGE_CELL_FACTORY_H__
-#define __GAIL_IMAGE_CELL_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_IMAGE_CELL_FACTORY (gail_image_cell_factory_get_type ())
-#define GAIL_IMAGE_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_IMAGE_CELL_FACTORY, GailImageCellFactory))
-#define GAIL_IMAGE_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_IMAGE_CELL_FACTORY, GailImageCellFactoryClass))
-#define GAIL_IS_IMAGE_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_IMAGE_CELL_FACTORY))
-#define GAIL_IS_IMAGE_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_IMAGE_CELL_FACTORY))
-#define GAIL_IMAGE_CELL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_IMAGE_CELL_FACTORY, GailImageCellFactoryClass))
-
-typedef struct _GailImageCellFactory GailImageCellFactory;
-typedef struct _GailImageCellFactoryClass GailImageCellFactoryClass;
-
-struct _GailImageCellFactory
-{
- AtkObjectFactory parent;
-};
-
-struct _GailImageCellFactoryClass
-{
- AtkObjectFactoryClass parent_class;
-};
-
-GType gail_image_cell_factory_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_IMAGE_CELL_FACTORY_H__ */
{
}
-AtkObject*
-gail_item_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_ITEM (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_ITEM, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_item_real_initialize (AtkObject *obj,
gpointer data)
GailContainerClass parent_class;
};
-AtkObject* gail_item_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
gail_label->label_length = g_utf8_strlen (label_text, -1);
}
-AtkObject*
-gail_label_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_LABEL (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_LABEL, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
notify_name_change (AtkObject *atk_obj)
{
GailWidgetClass parent_class;
};
-AtkObject* gail_label_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
static void gail_list_init (GailList *list);
+static void gail_list_initialize (AtkObject *accessible,
+ gpointer data);
+
static gint gail_list_get_index_in_parent (AtkObject *accessible);
static void atk_selection_interface_init (AtkSelectionIface *iface);
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+ class->initialize = gail_list_initialize;
class->get_index_in_parent = gail_list_get_index_in_parent;
}
{
}
-AtkObject*
-gail_list_new (GtkWidget *widget)
+static void
+gail_list_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_LIST (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_LIST, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
+ ATK_OBJECT_CLASS (gail_list_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_LIST;
-
- return accessible;
}
static gint
GailContainerClass parent_class;
};
-AtkObject* gail_list_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
{
}
-AtkObject*
-gail_menu_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_MENU (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_MENU, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- g_object_set_data (G_OBJECT (accessible), "atk-component-layer",
- GINT_TO_POINTER (ATK_LAYER_POPUP));
- return accessible;
-}
-
static void
gail_menu_real_initialize (AtkObject *obj,
gpointer data)
ATK_OBJECT_CLASS (gail_menu_parent_class)->initialize (obj, data);
obj->role = ATK_ROLE_MENU;
+
+ g_object_set_data (G_OBJECT (obj), "atk-component-layer",
+ GINT_TO_POINTER (ATK_LAYER_POPUP));
}
static AtkObject*
GailMenuShellClass parent_class;
};
-AtkObject* gail_menu_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
static void gail_menu_shell_class_init (GailMenuShellClass *klass);
static void gail_menu_shell_init (GailMenuShell *menu_shell);
+static void gail_menu_shell_initialize (AtkObject *accessible,
+ gpointer data);
static void atk_selection_interface_init (AtkSelectionIface *iface);
static gboolean gail_menu_shell_add_selection (AtkSelection *selection,
gint i);
static void
gail_menu_shell_class_init (GailMenuShellClass *klass)
{
+ AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
+
+ atk_object_class->initialize = gail_menu_shell_initialize;
}
static void
{
}
-AtkObject*
-gail_menu_shell_new (GtkWidget *widget)
+static void
+gail_menu_shell_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), NULL);
+ ATK_OBJECT_CLASS (gail_menu_shell_parent_class)->initialize (accessible, data);
- object = g_object_new (GAIL_TYPE_MENU_SHELL, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- if (GTK_IS_MENU_BAR (widget))
+ if (GTK_IS_MENU_BAR (data))
accessible->role = ATK_ROLE_MENU_BAR;
else
/*
* Accessible object for Menu is created in gailmenu.c
*/
accessible->role = ATK_ROLE_UNKNOWN;
-
- return accessible;
}
static void
GailContainerClass parent_class;
};
-AtkObject* gail_menu_shell_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
notebook->idle_focus_id = 0;
}
-AtkObject*
-gail_notebook_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_NOTEBOOK (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_NOTEBOOK, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static AtkObject*
gail_notebook_ref_child (AtkObject *obj,
gint i)
GailContainerClass parent_class;
};
-AtkObject* gail_notebook_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_DEFINE_TYPE (GailObject, gail_object, ATK_TYPE_GOBJECT_ACCESSIBLE)
-AtkObject*
-gail_object_new (GObject *obj)
-{
- gpointer object;
- AtkObject *atk_object;
-
- g_return_val_if_fail (GTK_IS_OBJECT (obj), NULL);
- object = g_object_new (GAIL_TYPE_OBJECT, NULL);
- atk_object = ATK_OBJECT (object);
- atk_object_initialize (atk_object, obj);
- return atk_object;
-}
-
static void
gail_object_class_init (GailObjectClass *klass)
{
AtkGObjectAccessibleClass parent_class;
};
-AtkObject* gail_object_new (GObject *obj);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
+++ /dev/null
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2003 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtk.h>
-#include "gailobjectfactory.h"
-#include "gailobject.h"
-
-static void gail_object_factory_class_init (GailObjectFactoryClass *klass);
-
-static AtkObject* gail_object_factory_create_accessible (GObject *obj);
-
-static GType gail_object_factory_get_accessible_type (void);
-
-GType
-gail_object_factory_get_type (void)
-{
- static GType type = 0;
-
- if (!type)
- {
- static const GTypeInfo tinfo =
- {
- sizeof (GailObjectFactoryClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) gail_object_factory_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (GailObjectFactory), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
- type = g_type_register_static (
- ATK_TYPE_OBJECT_FACTORY,
- "GailObjectFactory" , &tinfo, 0);
- }
-
- return type;
-}
-
-static void
-gail_object_factory_class_init (GailObjectFactoryClass *klass)
-{
- AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
- class->create_accessible = gail_object_factory_create_accessible;
- class->get_accessible_type = gail_object_factory_get_accessible_type;
-}
-
-static AtkObject*
-gail_object_factory_create_accessible (GObject *obj)
-{
- return gail_object_new (obj);
-}
-
-static GType
-gail_object_factory_get_accessible_type (void)
-{
- return GAIL_TYPE_OBJECT;
-}
+++ /dev/null
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2003 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_OBJECT_FACTORY_H__
-#define __GAIL_OBJECT_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_OBJECT_FACTORY (gail_object_factory_get_type ())
-#define GAIL_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_OBJECT_FACTORY, GailObjectFactory))
-#define GAIL_OBJECT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_OBJECT_FACTORY, GailObjectFactoryClass))
-#define GAIL_IS_OBJECT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_OBJECT_FACTORY))
-#define GAIL_IS_OBJECT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_OBJECT_FACTORY))
-#define GAIL_OBJECT_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_OBJECT_FACTORY, GailObjectFactoryClass))
-
-
-typedef struct _GailObjectFactory GailObjectFactory;
-typedef struct _GailObjectFactoryClass GailObjectFactoryClass;
-
-struct _GailObjectFactory
-{
- AtkObjectFactory parent;
-};
-
-struct _GailObjectFactoryClass
-{
- AtkObjectFactoryClass parent_class;
-};
-
-GType gail_object_factory_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_OBJECT_FACTORY_H__ */
-
{
}
-AtkObject*
-gail_option_menu_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_OPTION_MENU (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_OPTION_MENU, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_option_menu_real_initialize (AtkObject *obj,
gpointer data)
GailButtonClass parent_class;
};
-AtkObject* gail_option_menu_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
{
}
-AtkObject*
-gail_paned_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_PANED (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_PANED, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static AtkStateSet*
gail_paned_ref_state_set (AtkObject *accessible)
{
GailContainerClass parent_class;
};
-AtkObject* gail_paned_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
static void gail_pixmap_class_init (GailPixmapClass *klass);
static void gail_pixmap_init (GailPixmap *pixmap);
+static void gail_pixmap_initialize (AtkObject *accessible,
+ gpointer data);
/* AtkImage */
static void atk_image_interface_init (AtkImageIface *iface);
gail_pixmap_class_init (GailPixmapClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
+ atk_object_class->initialize = gail_pixmap_initialize;
+
gobject_class->finalize = gail_pixmap_finalize;
}
pixmap->image_description = NULL;
}
-AtkObject*
-gail_pixmap_new (GtkWidget *widget)
+static void
+gail_pixmap_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_assert (GTK_IS_PIXMAP (widget));
- g_return_val_if_fail (GTK_IS_PIXMAP (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_PIXMAP, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
+ ATK_OBJECT_CLASS (gail_pixmap_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_ICON;
-
- return accessible;
}
static void
GailWidgetClass parent_class;
};
-AtkObject* gail_pixmap_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GAIL_PIXMAP_H__ */
-
{
}
-AtkObject*
-gail_progress_bar_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_PROGRESS_BAR (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_PROGRESS_BAR, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_progress_bar_real_initialize (AtkObject *obj,
gpointer data)
GailWidgetClass parent_class;
};
-AtkObject* gail_progress_bar_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GAIL_PROGRESS_BAR_H__ */
-
-
static void gail_radio_button_class_init (GailRadioButtonClass *klass);
static void gail_radio_button_init (GailRadioButton *radio_button);
+static void gail_radio_button_initialize (AtkObject *accessible,
+ gpointer data);
static AtkRelationSet* gail_radio_button_ref_relation_set (AtkObject *obj);
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+ class->initialize = gail_radio_button_initialize;
class->ref_relation_set = gail_radio_button_ref_relation_set;
}
-AtkObject*
-gail_radio_button_new (GtkWidget *widget)
+static void
+gail_radio_button_init (GailRadioButton *radio_button)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_RADIO_BUTTON (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_RADIO_BUTTON, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- accessible->role = ATK_ROLE_RADIO_BUTTON;
- return accessible;
+ radio_button->old_group = NULL;
}
static void
-gail_radio_button_init (GailRadioButton *radio_button)
+gail_radio_button_initialize (AtkObject *accessible,
+ gpointer data)
{
- radio_button->old_group = NULL;
+ ATK_OBJECT_CLASS (gail_radio_button_parent_class)->initialize (accessible, data);
+
+ accessible->role = ATK_ROLE_RADIO_BUTTON;
}
AtkRelationSet*
GailToggleButtonClass parent_class;
};
-AtkObject* gail_radio_button_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
{
}
-AtkObject*
-gail_range_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_RANGE (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_RANGE, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_range_real_initialize (AtkObject *obj,
gpointer data)
GailWidgetClass parent_class;
};
-AtkObject* gail_range_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
+++ /dev/null
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2004 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkcellrenderer.h>
-#include "gailrenderercellfactory.h"
-#include "gailrenderercell.h"
-
-static void gail_renderer_cell_factory_class_init (GailRendererCellFactoryClass *klass);
-
-static AtkObject* gail_renderer_cell_factory_create_accessible (
- GObject *obj);
-static GType gail_renderer_cell_factory_get_accessible_type (void);
-
-GType
-gail_renderer_cell_factory_get_type (void)
-{
- static GType type = 0;
-
- if (!type)
- {
- static const GTypeInfo tinfo =
- {
- sizeof (GailRendererCellFactoryClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) gail_renderer_cell_factory_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (GailRendererCellFactory), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
- type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY,
- "GailRendererCellFactory" , &tinfo, 0);
- }
-
- return type;
-}
-
-static void
-gail_renderer_cell_factory_class_init (GailRendererCellFactoryClass *klass)
-{
- AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
- class->create_accessible = gail_renderer_cell_factory_create_accessible;
- class->get_accessible_type = gail_renderer_cell_factory_get_accessible_type;
-}
-
-static AtkObject*
-gail_renderer_cell_factory_create_accessible (GObject *obj)
-{
- g_return_val_if_fail (GTK_IS_CELL_RENDERER (obj), NULL);
-
- return gail_renderer_cell_new ();
-}
-
-static GType
-gail_renderer_cell_factory_get_accessible_type (void)
-{
- return GAIL_TYPE_RENDERER_CELL;
-}
+++ /dev/null
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2004 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_RENDERER_CELL_FACTORY_H__
-#define __GAIL_RENDERER_CELL_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_RENDERER_CELL_FACTORY (gail_renderer_cell_factory_get_type ())
-#define GAIL_RENDERER_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_RENDERER_CELL_FACTORY, GailRendererCellFactory))
-#define GAIL_RENDERER_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_RENDERER_CELL_FACTORY, GailRendererCellFactoryClass))
-#define GAIL_IS_RENDERER_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_RENDERER_CELL_FACTORY))
-#define GAIL_IS_RENDERER_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_RENDERER_CELL_FACTORY))
-#define GAIL_RENDERER_CELL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_RENDERER_CELL_FACTORY, GailRendererCellFactoryClass))
-
-typedef struct _GailRendererCellFactory GailRendererCellFactory;
-typedef struct _GailRendererCellFactoryClass GailRendererCellFactoryClass;
-
-struct _GailRendererCellFactory
-{
- AtkObjectFactory parent;
-};
-
-struct _GailRendererCellFactoryClass
-{
- AtkObjectFactoryClass parent_class;
-};
-
-GType gail_renderer_cell_factory_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_RENDERER_CELL_FACTORY_H__ */
gobject_class->notify = gail_scale_notify;
}
-AtkObject*
-gail_scale_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_RANGE (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_SCALE, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_scale_init (GailScale *scale)
{
GailRangeClass parent_class;
};
-AtkObject* gail_scale_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
static void gail_scrollbar_class_init (GailScrollbarClass *klass);
static void gail_scrollbar_init (GailScrollbar *accessible);
+static void gail_scrollbar_initialize (AtkObject *accessible,
+ gpointer data);
static gint gail_scrollbar_get_index_in_parent (AtkObject *accessible);
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+ class->initialize = gail_scrollbar_initialize;
class->get_index_in_parent = gail_scrollbar_get_index_in_parent;
}
{
}
-AtkObject*
-gail_scrollbar_new (GtkWidget *widget)
+static void
+gail_scrollbar_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_SCROLLBAR (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_SCROLLBAR, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
+ ATK_OBJECT_CLASS (gail_scrollbar_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_SCROLL_BAR;
-
- return accessible;
}
static gint
GailRangeClass parent_class;
};
-AtkObject* gail_scrollbar_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
{
}
-AtkObject*
-gail_scrolled_window_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_SCROLLED_WINDOW (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_SCROLLED_WINDOW, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_scrolled_window_real_initialize (AtkObject *obj,
gpointer data)
GailContainerClass parent_class;
};
-AtkObject* gail_scrolled_window_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
static void gail_separator_class_init (GailSeparatorClass *klass);
static void gail_separator_init (GailSeparator *accessible);
+static void gail_separator_initialize (AtkObject *accessible,
+ gpointer data);
static AtkStateSet* gail_separator_ref_state_set (AtkObject *accessible);
G_DEFINE_TYPE (GailSeparator, gail_separator, GAIL_TYPE_WIDGET)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+ class->initialize = gail_separator_initialize;
class->ref_state_set = gail_separator_ref_state_set;
}
{
}
-AtkObject*
-gail_separator_new (GtkWidget *widget)
+static void
+gail_separator_initialize (AtkObject *accessible,
+ gpointer data)
{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_SEPARATOR (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_SEPARATOR, NULL);
-
- g_return_val_if_fail (GTK_IS_ACCESSIBLE (object), NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
+ ATK_OBJECT_CLASS (gail_separator_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_SEPARATOR;
-
- return accessible;
}
static AtkStateSet*
GailWidgetClass parent_class;
};
-AtkObject *gail_separator_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
{
}
-AtkObject*
-gail_spin_button_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_SPIN_BUTTON (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_SPIN_BUTTON, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_spin_button_real_initialize (AtkObject *obj,
gpointer data)
GailEntryClass parent_class;
};
-AtkObject* gail_spin_button_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
{
}
-AtkObject*
-gail_statusbar_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_STATUSBAR (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_STATUSBAR, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static G_CONST_RETURN gchar*
gail_statusbar_get_name (AtkObject *obj)
{
GailContainerClass parent_class;
};
-AtkObject* gail_statusbar_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
+++ /dev/null
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkcellrenderertext.h>
-#include "gailtextcellfactory.h"
-#include "gailtextcell.h"
-
-static void gail_text_cell_factory_class_init (GailTextCellFactoryClass *klass);
-
-static AtkObject* gail_text_cell_factory_create_accessible (
- GObject *obj);
-
-static GType gail_text_cell_factory_get_accessible_type (void);
-
-GType
-gail_text_cell_factory_get_type (void)
-{
- static GType type = 0;
-
- if (!type)
- {
- static const GTypeInfo tinfo =
- {
- sizeof (GailTextCellFactoryClass),
- (GBaseInitFunc) NULL, /* base init */
- (GBaseFinalizeFunc) NULL, /* base finalize */
- (GClassInitFunc) gail_text_cell_factory_class_init, /* class init */
- (GClassFinalizeFunc) NULL, /* class finalize */
- NULL, /* class data */
- sizeof (GailTextCellFactory), /* instance size */
- 0, /* nb preallocs */
- (GInstanceInitFunc) NULL, /* instance init */
- NULL /* value table */
- };
- type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY,
- "GailTextCellFactory" , &tinfo, 0);
- }
-
- return type;
-}
-
-static void
-gail_text_cell_factory_class_init (GailTextCellFactoryClass *klass)
-{
- AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
- class->create_accessible = gail_text_cell_factory_create_accessible;
- class->get_accessible_type = gail_text_cell_factory_get_accessible_type;
-}
-
-static AtkObject*
-gail_text_cell_factory_create_accessible (GObject *obj)
-{
- g_return_val_if_fail (GTK_IS_CELL_RENDERER_TEXT (obj), NULL);
-
- return gail_text_cell_new ();
-}
-
-static GType
-gail_text_cell_factory_get_accessible_type (void)
-{
- return GAIL_TYPE_TEXT_CELL;
-}
+++ /dev/null
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_TEXT_CELL_FACTORY_H__
-#define __GAIL_TEXT_CELL_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_TEXT_CELL_FACTORY (gail_text_cell_factory_get_type ())
-#define GAIL_TEXT_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_TEXT_CELL_FACTORY, GailTextCellFactory))
-#define GAIL_TEXT_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_TEXT_CELL_FACTORY, GailTextCellFactoryClass))
-#define GAIL_IS_TEXT_CELL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_TEXT_CELL_FACTORY))
-#define GAIL_IS_TEXT_CELL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_TEXT_CELL_FACTORY))
-#define GAIL_TEXT_CELL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_TEXT_CELL_FACTORY, GailTextCellFactoryClass))
-
-typedef struct _GailTextCellFactory GailTextCellFactory;
-typedef struct _GailTextCellFactoryClass GailTextCellFactoryClass;
-
-struct _GailTextCellFactory
-{
- AtkObjectFactory parent;
-};
-
-struct _GailTextCellFactoryClass
-{
- AtkObjectFactoryClass parent_class;
-};
-
-GType gail_text_cell_factory_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_TEXT_CELL_FACTORY_H__ */
G_OBJECT_CLASS (gail_text_view_parent_class)->finalize (object);
}
-AtkObject*
-gail_text_view_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_TEXT_VIEW (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_TEXT_VIEW, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_text_view_real_notify_gtk (GObject *obj,
GParamSpec *pspec)
GailContainerClass parent_class;
};
-AtkObject* gail_text_view_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
{
}
-AtkObject*
-gail_toggle_button_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_TOGGLE_BUTTON (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_TOGGLE_BUTTON, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_toggle_button_real_initialize (AtkObject *obj,
gpointer data)
GailButtonClass parent_class;
};
-AtkObject* gail_toggle_button_new( GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
static void gail_toplevel_class_init (GailToplevelClass *klass);
static void gail_toplevel_init (GailToplevel *toplevel);
+static void gail_toplevel_initialize (AtkObject *accessible,
+ gpointer data);
static void gail_toplevel_object_finalize (GObject *obj);
/* atkobject.h */
G_DEFINE_TYPE (GailToplevel, gail_toplevel, ATK_TYPE_OBJECT)
-AtkObject*
-gail_toplevel_new (void)
-{
- GObject *object;
- AtkObject *accessible;
-
- object = g_object_new (GAIL_TYPE_TOPLEVEL, NULL);
- g_return_val_if_fail ((object != NULL), NULL);
-
- accessible = ATK_OBJECT (object);
- accessible->role = ATK_ROLE_APPLICATION;
- accessible->name = g_get_prgname();
- accessible->accessible_parent = NULL;
-
- return accessible;
-}
-
static void
gail_toplevel_class_init (GailToplevelClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
+ class->initialize = gail_toplevel_initialize;
class->get_n_children = gail_toplevel_get_n_children;
class->ref_child = gail_toplevel_ref_child;
class->get_parent = gail_toplevel_get_parent;
gail_toplevel_hide_event_watcher, toplevel, (GDestroyNotify) NULL);
}
+static void
+gail_toplevel_initialize (AtkObject *accessible,
+ gpointer data)
+{
+ ATK_OBJECT_CLASS (gail_toplevel_parent_class)->initialize (accessible, data);
+
+ accessible->role = ATK_ROLE_APPLICATION;
+ accessible->name = g_get_prgname();
+ accessible->accessible_parent = NULL;
+}
+
static void
gail_toplevel_object_finalize (GObject *obj)
{
AtkObjectClass parent_class;
};
-AtkObject *gail_toplevel_new(void);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
GAIL_WIDGET_CLASS (gail_tree_view_parent_class)->notify_gtk (obj, pspec);
}
-AtkObject*
-gail_tree_view_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), NULL);
-
- object = g_object_new (GAIL_TYPE_TREE_VIEW, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- return accessible;
-}
-
static void
gail_tree_view_finalize (GObject *object)
{
GailContainerClass parent_class;
};
-AtkObject* gail_tree_view_new (GtkWidget *widget);
-
AtkObject* gail_tree_view_ref_focus_cell (GtkTreeView *treeview);
#ifdef __cplusplus
gail_util_get_root (void)
{
if (!root)
- root = gail_toplevel_new();
+ {
+ root = g_object_new (GAIL_TYPE_TOPLEVEL, NULL);
+ atk_object_initialize (root, NULL);
+ }
return root;
}
G_TYPE_NONE, 0);
}
-AtkObject*
-gail_window_new (GtkWidget *widget)
-{
- GObject *object;
- AtkObject *accessible;
-
- gail_return_val_if_fail (widget != NULL, NULL);
- /*
- * A GailWindow can be created for a GtkHandleBox or a GtkWindow
- */
- if (!GTK_IS_WINDOW (widget) &&
- !GTK_IS_HANDLE_BOX (widget))
- gail_return_val_if_fail (FALSE, NULL);
-
- object = g_object_new (GAIL_TYPE_WINDOW, NULL);
-
- accessible = ATK_OBJECT (object);
- atk_object_initialize (accessible, widget);
-
- /*
- * Notify that tooltip is showing
- */
- if (accessible->role == ATK_ROLE_TOOL_TIP &&
- GTK_WIDGET_MAPPED (widget))
- atk_object_notify_state_change (accessible, ATK_STATE_SHOWING, 1);
-
- return accessible;
-}
-
static void
gail_window_init (GailWindow *accessible)
{
GtkWidget *widget;
GailWindow *window;
+ /*
+ * A GailWindow can be created for a GtkHandleBox or a GtkWindow
+ */
+ if (!GTK_IS_WINDOW (widget) &&
+ !GTK_IS_HANDLE_BOX (widget))
+ gail_return_if_fail (FALSE);
+
ATK_OBJECT_CLASS (gail_window_parent_class)->initialize (obj, data);
window = GAIL_WINDOW (obj);
else
obj->role = ATK_ROLE_FRAME;
}
+
+ /*
+ * Notify that tooltip is showing
+ */
+ if (obj->role == ATK_ROLE_TOOL_TIP &&
+ GTK_WIDGET_MAPPED (widget))
+ atk_object_notify_state_change (obj, ATK_STATE_SHOWING, 1);
}
static void
GailContainerClass parent_class;
};
-AtkObject* gail_window_new (GtkWidget *widget);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */